<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户管理</title>
<link rel="stylesheet" href="../css/common.css" type="text/css" />
</head>
<body>
<div id="man_zone" align="left">
<center><c:out value="${message}" /></center>
<form id="form1" name="form1" method="post"
	action="user.do?method=query">
<table class="table_qry" border="0" cellpadding="3" cellspacing="1">
	<tr>
		<td>姓名</td>
		<td><input type="text" name="name" id="name" value='<c:out value="${name}"/>' /></td>
		<td>工号</td>
		<td><input type="text" name="empno" id="empno" value='<c:out value="${empno}"/>' /></td>
		<td>角色:</td>
            <td><select id="roleId" name="roleId">
        <option value="">请选择</option>
        	<c:if test="${rolelist != null}">
        		<c:forEach items="${rolelist}" var="role" varStatus="status">
        			<option value='<c:out value="${role.ROLE_ID}"/>'><c:out value="${role.ROLE_NAME}"/></option>
        		</c:forEach>
        	</c:if>
          </select></td>
		<td><input type="hidden" name="prv" value="query" />    <input type="submit" value="查询" /></td>
		<td>
		 <c:if test="${prv.insert != null}">
		 <input name="button" type="button" class="STYLE2" value="添加"
			onclick="javascript:location.href='user.do?method=add&prv=insert';" />
         </c:if>
         </td>
	</tr>
</table>
<table class="table_style" width="99%" border="0" align="center"
	cellpadding="3" cellspacing="1">
	<tr>
	    <th>姓名</th>
	    <th>角色</th>
	    <th>工号</th>
	    <th>部门</th>
	    <th>状态</th>
	    <th>操作</th>
	</tr>
	<c:forEach items="${bean.datas}" var="item" varStatus="status">
		<tr>
			<td class="table_text"><c:out
				value="${item.name}" />
			</td>
			<td class="table_text"><c:out
				value="${item.roleName}" />
			</td>
			<td class="table_text"><c:out
				value="${item.empno}" />
			</td>
			<td class="table_text"><c:out
				value="${item.depName}" />
			</td>
			<td class="table_text">
			<c:if test="${item.state == 1}">正常</c:if>
			<c:if test="${item.state == -1}">删除</c:if>
			</td>
			<td class="table_text">
			<c:if test="${prv.update != null}">
					<a href="#"
						onclick="javascript:location.href='user.do?method=searchById&prv=update&type=1&id=<c:out value="${item.id}"/> ';">修改</a>
				</c:if>
				<c:if test="${prv.look != null }">
					<a href="#"
						onclick="javascript:location.href='user.do?method=searchById&prv=look&type=2&id=<c:out value="${item.id}"/>';">查看</a>
				</c:if>
				<c:if test="${prv.delete != null }">
					<a href="#"
						onclick="javascript:if (confirm('确认删除吗?')) {location.href='user.do?method=delete&prv=delete&id=<c:out value="${item.id}"/>'};">删除</a>
				</c:if>
				<c:if test="${prv.reset != null }">
					<a href="#"
						onclick="javascript:if (confirm('确认密码重置吗?')) {location.href='user.do?method=passReset&prv=reset&id=<c:out value="${item.id}"/>&empno=<c:out value="${item.empno}"/>'};">密码重置</a>
				</c:if>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td align="left" colspan="7" height="35" bgcolor="#FFFFFF"><!-- 页面隐藏域信息 -->
		<c:out value="${bean.fliper.formathtml}" escapeXml="false" /> <!-- 分页显示信息 -->
		<c:out value="${bean.footerhtml}" escapeXml="false" /></td>
	</tr>
</table>
</form>
</div>
</body>
</html>